-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix formatting of trailing unescaped quotes in raw triple quoted strings #6202
Conversation
…ngs. **Summary** This prevents us from turning `r'''\""'''` into `r"""\"""""`, which is invalid syntax. This PR fixes CI, which is currently broken on main (in a way that still passes on linter PRs and allows merging formatter PRs, but it's bad to have a job be red). Once merged, i'll make the formatted ecosystem checks a required check. **Test Plan** Added a regression test.
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
// We can't turn `r'''\""'''` into `r"""\"""""`, the last previously inner quote | ||
// we shorten the quoted part and turn the last triple quote char into an | ||
// unterminated string start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment. What I understand from the code is that the match now returns true
for a single quote at the end of the string. What about a triple quoted string that ends with two quotes?
'''""'''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, fixed
PR Check ResultsBenchmarkLinux
Windows
|
Summary This prevents us from turning
r'''\""'''
intor"""\"""""
, which is invalid syntax.This PR fixes CI, which is currently broken on main (in a way that still passes on linter PRs and allows merging formatter PRs, but it's bad to have a job be red). Once merged, i'll make the formatted ecosystem checks a required check.
Test Plan Added a regression test.